﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RBS.Admin.Controllers;
using RBS.Core.BLL;

namespace RBS.Admin.Areas.Chart.Controllers
{
    public class HotelChartController : BaseController
    {
        readonly SpBll _spBll = new SpBll();  
        /// <summary>
        /// 热门酒店
        /// </summary>
        /// <param name="beginTime"></param>
        /// <param name="endTime"></param>
        /// <returns></returns>
        public ActionResult HotHotelChart(string beginTime=null,string endTime=null)
        {
            if (beginTime == null) beginTime = DateTime.Now.AddMonths(-1).ToShortDateString();
            if (endTime == null) endTime = DateTime.Now.AddMonths(1).ToShortDateString();
            var list = _spBll.GetHotHotelChart(Convert.ToDateTime(beginTime), Convert.ToDateTime(endTime));
            ViewData.Model = list;
            return View();
        }
         
        public ActionResult HotelConsumptionChart()
        {
            var list = _spBll.GetHotelConsumptionChart();
            ViewData.Model = list;
            return View();
        } 

        public ActionResult HotelHotCookBookAdmin(string beginTime = null, string endTime = null)
        {
            if (beginTime == null) beginTime = DateTime.Now.AddMonths(-1).ToShortDateString();
            if (endTime == null) endTime = DateTime.Now.AddMonths(1).ToShortDateString();
            var list = _spBll.GetHotelHotCookBookAdmin(Convert.ToDateTime(beginTime), Convert.ToDateTime(endTime));
            ViewData.Model = list;
            return View();
        }
    }
}
